import instance from '@/utils/request'
export function getSimpleUserApi () {
  return instance({
    url: '/sys/user/simple'
  })
}
// 获取员工列表
export function getEmployeeListapi (params) {
  return instance({
    url: '/sys/user',
    params
  })
}
// 删除员工
export function delEmployeeApi (id) {
  return instance({
    url: `/sys/user/${id}`,
    method: 'delete'
  })
}
// 新增员工
export function addEmpApi (data) {
  return instance({
    url: '/sys/user',
    method: 'POST',
    data
  })
}
// 批量导入
export function userBatchApi (data) {
  return instance({
    url: '/sys/user/batch',
    method: 'post',
    data
  })
}
// 获取某个用户的基本信息
export function getuserinfoApi (id) {
  return instance({
    url: `/sys/user/${id}`
  })
}
// 保存员工的基本信息
export function setUserInfoApi (data) {
  return instance({
    url: `/sys/user/${data.id}`,
    method: 'put',
    data
  })
}
// 获取员工个人信息
export function getUserDetailApi (id) {
  return instance({
    url: `/employees/${id}/personalInfo`
  })
}

// 保存员工个人信息
export function setUserDetailApi (data) {
  return instance({
    url: `/employees/${data.userId}/personalInfo`,
    method: 'PUT',
    data
  })
}
// 获取员工岗位信息
export function getjobsApi (id) {
  return instance({
    url: `/employees/${id}/jobs`
  })
}
//  分配员工角色
export function sysuserAssignRolesApi (data) {
  return instance({
    url: '/sys/user/assignRoles',
    method: 'PUT',
    data
  })
}
